package com.ktwlsoft.archivemanage.domain.business.repositoryService.study;

import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ktwlsoft.archivemanage.domain.dao.entity.study.StudyKnowledge;
import com.ktwlsoft.archivemanage.domain.dao.repository.study.StudyKnowledgeMapper;
import lombok.Getter;
import org.springframework.stereotype.Service;

/**
 * 知识库
 *
 * @author Name on 2019/12/30 9:50
 * @version 1.0
 */
@Service
public class StudyKnowledgeRepositoryService {

    @Getter
    private final StudyKnowledgeMapper studyKnowledgeMapper;

    public StudyKnowledgeRepositoryService(StudyKnowledgeMapper studyKnowledgeMapper) {
        this.studyKnowledgeMapper = studyKnowledgeMapper;
    }

    public PageInfo<StudyKnowledge> findPage(int pn, int pageSize, JSONObject jsonObject){
        PageHelper.startPage(pn,pageSize);
        return new PageInfo<>(studyKnowledgeMapper.findList(jsonObject));
    }
}